package com.startdima.user.infrastructure.vo;

import java.io.Serializable;
import java.util.Optional;

import javax.validation.constraints.NotBlank;

import org.apache.commons.lang3.StringUtils;

import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.ToString;

@Data
@NoArgsConstructor
@ToString
public class LoginVo implements Serializable {
	
    private static final long serialVersionUID = 2579858261187348360L;
 
    @NotBlank(message="账号不能为空")
    private String username;
 
    @NotBlank(message="密码不能为空")
    private String password;
 
    public String getUserName() {
        return Optional.ofNullable(username).orElse(StringUtils.EMPTY);
    }

}